import 'package:flutter_test/flutter_test.dart';
import 'package:umeng_analytics_plugin/umeng_analytics_plugin_platform_interface.dart';
import 'package:umeng_analytics_plugin/umeng_analytics_plugin_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockUmengAnalyticsPluginPlatform
    with MockPlatformInterfaceMixin
    implements UmengAnalyticsPluginPlatform {

  @override
  Future<String> getPlatformVersion() => Future.value('42');
}

void main() {
  final UmengAnalyticsPluginPlatform initialPlatform = UmengAnalyticsPluginPlatform.instance;

  test('$MethodChannelUmengAnalyticsPlugin is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelUmengAnalyticsPlugin>());
  });

  test('getPlatformVersion', () async {
    MockUmengAnalyticsPluginPlatform fakePlatform = MockUmengAnalyticsPluginPlatform();
    UmengAnalyticsPluginPlatform.instance = fakePlatform;

    expect(await UmengAnalyticsPluginPlatform.instance.getPlatformVersion(), '42');
  });
}
